home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_hornerswatch.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  183 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_hornerswatch.cog
  4. #    
  5. # Get Horner's watch
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message     startup
  14. message        entered
  15. message        activated
  16.  
  17. # world things
  18. thing    player        local
  19. thing    indyactor    nolink
  20. thing    skeleton    nolink
  21. thing    watch
  22.  
  23. # cams and lookthings
  24. thing    watchcam        nolink
  25. thing    watchcamlook    nolink
  26.  
  27. # sectors
  28. sector    watchsector1
  29. sector    watchsector2
  30.  
  31. # animations
  32. keyframe    grabwatch=in_activate_low.key    local
  33. keyframe    lookwatch=0in_turngear.key        local
  34.  
  35. # models
  36. model          mod_in_watchhand=hand_in_watch.3do        local
  37.  
  38. # indy saylines
  39. sound    pocketwatch=pr10j01.wav    local
  40. sound    inscribed=pr10j02.wav    local
  41. sound    luckyday=pr10j03.wav    local
  42. sound    whatsthis=inxj002.wav    local
  43.  
  44. # music
  45. sound    hornermus=mus_gen_eerie2.wav    local
  46.  
  47. # variables
  48. int        spoken=0    local
  49. int        curkey=0    local
  50. int        cursound=0    local
  51. int        curmodel=0    local
  52.  
  53. # subroutines
  54. flex    startscene=0.0    local
  55. flex    endscene=0.0    local
  56. flex    fixcams=0.0        local
  57. end
  58.  
  59. code
  60. startup:
  61.     sleep(.01);
  62.     player = GetLocalPlayerThing();
  63.  
  64.     #light and decollisionize horner's skeleton
  65.     SetCollideType(skeleton, 0);
  66.     SetThingLight(skeleton, '0.5 0.43 0.37', .001, .01);
  67.     SetThingLight(watch, '0.5 0.43 0.37', .001, .01);
  68.     return;
  69.  
  70. entered:
  71. # ---> watchsectors
  72.     
  73.     # if not entering watchsectors, or if sector is a falling death sector, exit
  74.     if ((GetSenderRef() != watchsector1) && (GetSenderRef() != watchsector2)) return;
  75.     if (GetSectorFlags(GetSenderRef()) & 0x40) return;
  76.  
  77.     if (spoken) return;
  78.     spoken = 1;
  79.     
  80.     # Indy: What's this?
  81.     cursound = PlaySoundLocal(hornermus, 1.0, 0, 0x0, 0);
  82.     cursound = PlayVoice(player, whatsthis, .5, 0);
  83.     return;
  84.  
  85. activated:
  86. # ---) watch
  87.     DeselectWeaponWait(player);
  88.  
  89.     call startscene;
  90.     
  91.     SetExtCamOffsetToThing(watchcam);
  92.  
  93.     #make indy turn toward the skeleton
  94.     SetThingMaxRotVel(indyactor, 175);
  95.     AIEnableBodyTracking(indyactor, skeleton);
  96.     sleep(.1);
  97.     AIEnableHeadTracking(indyactor, skeleton);
  98.  
  99.     cursound = PlayVoice(indyactor, pocketwatch, 1, 0);
  100.     sleep(1);
  101.     
  102.     # indy grabs watch, destroy the watch
  103.     curkey = PlayKey(indyactor, grabwatch, 4, 0x12, 0);
  104.     sleep(1);
  105.     DestroyThing(watch);
  106.  
  107.     sleep(1.5);
  108.     curkey = PlayKey(indyactor, lookwatch, 4, 0x14, 0);
  109.  
  110.     # put watch in indy's hands
  111.     curmodel = SetThingMesh(indyactor, 12, mod_in_watchhand, 0);
  112.     
  113.     sleep(.5);
  114.     cursound = PlayVoice(player, inscribed, 1, 1);
  115.  
  116.     AIDisableHeadTracking(indyactor);
  117.     AIDisableBodyTracking(indyactor);
  118.  
  119.     if (global3 == 2)
  120.     {
  121.         sleep(1);
  122.         cursound = PlayVoice(player, luckyday, 1, 0);
  123.     }
  124.  
  125.     StopKey(indyactor, curkey, 1.0);
  126.  
  127.     # add watch to inventory
  128.     SetInvAvailable(player, 100, 1);
  129.     ChangeInv(player, 100, 1.0);
  130.     JonesInvItemChanged(100);
  131.     Sleep(1);
  132.  
  133.     # get the watch out of his hands
  134.     RestoreThingMesh(indyactor, curmodel);
  135.     
  136.     Sleep(1);
  137.  
  138.     call endscene;
  139.     return;
  140.  
  141. startscene:
  142.     call fixcams;
  143.  
  144.     StartCutscene(1);
  145.     TeleportThing(indyactor, player);
  146.     CopyPlayerHolsters(player, indyactor);
  147.     ClearThingFlags(indyactor, 0x80000);
  148.     StopThing(player);
  149.     SetActorFlags(player, 0x200000);
  150.     SetThingFlags(player, 0x80000);
  151.         
  152.     return;
  153.             
  154. endscene:
  155.     call fixcams;
  156.  
  157.     TeleportThing(player, indyactor);
  158.     SetThingFlags(indyactor, 0x80000);
  159.     ClearThingFlags(player, 0x80000);
  160.     ClearActorFlags(player, 0x200000);
  161.  
  162.     RestoreExtCam();
  163.     EndCutscene();
  164.     
  165.     # cleanup
  166.     DestroyThing(indyactor);
  167.     DestroyThing(watchcam);
  168.     DestroyThing(watchcamlook);
  169.     
  170.     return;
  171.  
  172. fixcams:
  173.     # reset camera settings
  174.     ResetCameraFOV(0, 0);
  175.     SetCameraPosInterp(2, 0);
  176.     SetCameraLookInterp(2, 0);
  177.     RestoreExtCam();
  178.     return;
  179.  
  180. end
  181.  
  182.  
  183.